// JavaScript Document
/*
Style Name:
Author:xuanliwei
*/

//关闭层 换掉二a级的class
function CloseDiv(name){
	var con = document.getElementById(name);
	var ul_class = document.getElementById("nav").getElementsByTagName("ul");
	for(var i=0;i<ul_class.length;i++){					
			var a_lsit=ul_class[i].getElementsByTagName("A");
			for(j=0;j<a_lsit.length;j++){
				a_lsit[j].className="";
				}
		if(ul_class[i].className=="display_block"){			
			ul_class[i].className="display_none";
			}
		
		}
	con.className=con.className=='display_none'?'display_block':'display_none';
}
function CloseDiv_2(name){
	var con = document.getElementById(name);
	con.className=con.className=='display_block'?'display_none':'display_block';
}
function setDiv(obj){	
	var first_list =document.getElementById("nav").getElementsByTagName("A");
	for(var i=0;i<first_list.length;i++){
		if(first_list[i].className=="select_main_nav"){			
			first_list[i].className="";
			}
		
		}
obj.className=obj.className=='select_main_nav'?'':'select_main_nav';
}
//二级菜单显示隐藏
function setDiv_2(obj){	
		if(obj.className==""){
		obj.className="hover";
		}
		else{
		obj.className="";
			}
}
  function ChangeNav(name,cursel,m){//name是Nav0; cursel是数字; m是个数.
 var firstlist =document.getElementById("nav").getElementsByTagName("A");
 for(var i=0;i<firstlist.length;i++){
		if(firstlist[i].className=="selct_nav"){			
			firstlist[i].className="";
			}
		}
 for(i=1;i<=m;i++){
  var menu=document.getElementById(name+i);
menu.childNodes[0].className=i==cursel?"selct_nav":"";
 }
}



